package com.rc.saas.tenant.vo.recharge;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.rc.saas.tenant.common.utils.StringUtil;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author frog
 * @date 2021/9/15
 */
public class ExportRechargeOrderVo{
    @ExcelProperty(value = "运营商代码",index = 0)
    private String tenantCode;
    @ExcelProperty(value = "会员名",index = 1)
    private String nickname;
    @ExcelProperty(value = "会员手机号",index = 2)
    private String mobile;
    @ExcelProperty(value = "商户订单号",index = 3)
    private String outTradeNo;
    @ExcelProperty(value = "支付订单号",index = 4)
    private String transactionId;
    @ExcelProperty(value = "充值金额",index = 5)
    private BigDecimal amount;
    @ExcelProperty(value = "优惠金额",index = 6)
    private BigDecimal discountAmount;
    @ExcelProperty(value = "实扣金额",index = 7)
    private BigDecimal factAmount;
    @ExcelProperty(value = "充值方式",index = 8)
    private String rechargeType;
    @ExcelProperty(value = "支付方式",index = 9)
    private String paymentType;
    @ExcelProperty(value = "到帐时间",index = 10)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date finishTime;
    @ExcelProperty(value = "到帐状态",index = 11)
    private String status;
    @ExcelProperty(value = "创建时间",index = 12)
    private Date createdTime;

    public String getRechargeType() {
        if (StringUtil.isNotBlank(rechargeType)) {
            if ("0".equals(rechargeType)) {
                return "公众号";
            } else if ("1".equals(rechargeType)) {
                return "APP";
            } else if ("2".equals(rechargeType)) {
                return "小程序";
            }
        }
        return "";
    }

    public String getpaymentType() {
        if (StringUtil.isNotBlank(paymentType)) {
            if ("0".equals(paymentType)) {
                return "微信支付";
            } else if ("1".equals(paymentType)) {
                return "支付宝";
            } else if ("Z0".equals(paymentType)) {
                return "中行微信";
            } else if ("Z1".equals(paymentType)) {
                return "中行支付宝";
            } else if ("U".equals(paymentType)) {
                return "银联支付";
            } else if ("C".equals(paymentType)) {
                return "农行支付";
            } else if ("ZX".equals(paymentType)) {
                return "中行微信支付";
            }
        }
        return "";
    }

    public String getStatus() {
        if (StringUtil.isNotBlank(status)) {
            if ("0".equals(status)) {
                return "未到账";
            } else if ("1".equals(status)) {
                return "已到账";
            }
        }
        return "";
    }

    public String getTenantCode() {
        return tenantCode;
    }

    public void setTenantCode(String tenantCode) {
        this.tenantCode = tenantCode;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getDiscountAmount() {
        return discountAmount;
    }

    public void setDiscountAmount(BigDecimal discountAmount) {
        this.discountAmount = discountAmount;
    }

    public BigDecimal getFactAmount() {
        return factAmount;
    }

    public void setFactAmount(BigDecimal factAmount) {
        this.factAmount = factAmount;
    }

    public void setRechargeType(String rechargeType) {
        this.rechargeType = rechargeType;
    }

    public void setPaymentType(String paymentType) {
        this.paymentType = paymentType;
    }

    public Date getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }
}
